<%-- 
    Document   : register
    Created on : 2019-9-24, 11:09:19
    Author     : 10592
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link type="text/css" rel="stylesheet" href="css/style.css" />
    </head>
    <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
    <script type="text/javascript" >
    $(function(){

            $("#s1").css("display", "none");
            $("#s2").css("display", "none");
            $("#s3").css("display", "none");
            $("#s4").css("display", "none");
            
            $("input[name='userName']").blur(function(){
                 $.get("Login.html?flag=5",
                 {userName: $("input[name='userName']").val()},
                 function (result, status) {
                    if (result == "用户存在") {
                        $("#s1").css("display", "inline");
                    }else  if (result == "用户不存在"){
                        $("#s1").css("display", "none");
                    }
                });
              });
             $("input[name='rePassWord']").blur(function(){
                 $.get("Login.html?flag=4",
                 {rePassWord : $("input[name='rePassWord']").val(),passWord : $("input[name='passWord']").val()},
                 function (result, status) {
                    if (result == "两次密码输入不一致") {
                        $("#s3").css("display", "inline");
                    }else  if (result == "两次密码输入一致"){
                        $("#s3").css("display", "none");
                    }
                });
            });
            $("input[name='email']").blur(function(){
                 $.get("Login.html?flag=3",
                 {email : $("input[name='email']").val()},
                 function (result, status) {
                    if (result == "邮箱输入不正确") {
                        $("#s4").css("display", "inline");
                    }else  if (result == "邮箱输入正确"){
                        $("#s4").css("display", "none");
                    }
                });
            });
            
        });

    </script>
    <body>
        <div id="header" class="wrap">
            <div id="logo">网上书城</div>
            <div id="navbar">
                <form method="get" name="search" action="">
                    搜索：<input class="input-text" type="text" name="keywords" /><input class="input-btn" type="submit" name="submit" value="" />
                </form>
            </div>
        </div>
        <div id="register">
            <div class="title">
                <h2>欢迎注册网上书城</h2>
            </div>
            <div class="steps">
                <ul class="clearfix">
                    <li class="current">1.填写注册信息</li>
                    <li class="unpass">2.注册成功</li>
                </ul>
            </div>
            <form method="post" action="Login.html">
                <input type="hidden" name="flag" value="2">
                <dl>
                    <dt>用 户 名：</dt>
                    <dd><input class="input-text" type="text" name="userName" id="I1" /><span id="s1">当前用户已存在！</span></dd>
                    <dt>密　　码：</dt>
                    <dd><input class="input-text" type="password" name="passWord" id="I2"/><span id="s2">密码过于简单！</span></dd>
                    <dt>确认密码：</dt>
                    <dd><input class="input-text" type="password" name="rePassWord" id="I3"/><span id="s3">两次密码输入不一致！</span></dd>
                    <dt>Email地址：</dt>
                    <dd><input class="input-text" type="text" name="email" id="I4"/><span id="s4">邮箱输入不正确！</span></dd>
                    <dt></dt>
                    <dd class="button"><input class="input-reg" type="submit" name="register" value="" /></dd>
                </dl>
            </form>
        </div>
        <div id="footer" class="wrap">
            网上书城 &copy; 版权所有

        </div>
    </body>
</html>
